pandas filter dataframe if an elemnt is in alist

36

In [30]:
df[df['id'].isin(['foo','bar'])]

Out[30]:
   value   id
0      1  foo
1      2  bar

Comments

Submit
0 Comments